package mlz.d_math;

//Math: 数学类 (进行数学运算的)
public class MathDemo {
    public static void main(String[] args) {
        //获取绝对值
        System.out.println(Math.abs(-12));//12

        //向上取整
        System.out.println(Math.ceil(4.0000001));//5.0

        //向下取整
        System.out.println(Math.floor(4.9999999));//4.0


        //四舍五入
        System.out.println(Math.round(3.49999999));//3
        System.out.println(Math.round(3.500000));//4

        //最大值
        System.out.println(Math.max(10,20));//20

    }
}
